﻿namespace CodeParser.Tokens
{
    public class SingleChar
        : TokenParser
    {

        public SingleChar(TokenType type, char @char)
            : base(type)
        {
            Char = @char;
        }

        public override Token GetTokenAt(string source, int index)
        {
            return source[index] == Char ? new Token() { Index = index, Type = Type.Value, Value = string.Empty + Char } : null;
        }

        public char Char;

    }
}
